using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Business;
using Entity;

public partial class CustomerPage_CusLogin : System.Web.UI.Page
{
    //bCustomer bcustomer = new bCustomer();
    //DataTable dt = new DataTable();
    
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //txtUsername.Text = Request.Cookies["CustomerCookie"]["Username"];
            //txtPassword.Text = Request.Cookies["CustomerCookie"]["Password"];
            
        }
        
    }

    protected void btnLogin_Click(object sender, EventArgs e)
    {
        lblCheck.Text = "";
        eCustormer customer = bCustomer.CustormerLogin(txtUsername.Text, txtPassword.Text);
        if (customer != null)
        {
            Session["customer"] = customer;
            Response.Redirect("Default.aspx");           
        }
        else
        {
            lblCheck.Text = "Login Failed! Invalid Username or Password";
        }
    }
}
